/* 库存管理-物料管理api */

import { ajaxService } from '@/utils/request';

const env = import.meta.env;
// let baseURL = env.VITE_API_BASE_URL;
let baseURL = env.VITE_INVENTORY_URL;
let appUrl = env.VITE_INVENTORYx_URL;

// 获取库位列表(树形)
export function GetLocationAll(params?: any) {
  return ajaxService({
    url: '/warehouse/location/getAll',
    method: 'get',
    baseURL,
    params,
  });
}

// 获取库位列表(扁平)
export function GetLocationData(params?: any) {
  return ajaxService({
    url: '/warehouse/location/get',
    method: 'get',
    baseURL,
    params,
  });
}

// 新增仓库/库区
export function postLocation(data: any) {
  return ajaxService({
    url: '/warehouse/location/add',
    method: 'post',
    baseURL,
    data,
  });
}

// 编辑仓库/库区
export function putLocation(data: any) {
  return ajaxService({
    url: '/warehouse/location/put',
    method: 'put',
    baseURL,
    data,
  });
}

// 删除物料/产品分类
export function delLocation(params: any) {
  return ajaxService({
    url: '/warehouse/shelves/detlete',
    method: 'delete',
    baseURL,
    params,
  });
}

// 查询单一库位详情
export function getLocationOne(params: any) {
  return ajaxService({
    url: '/warehouse/location/getOne',
    method: 'get',
    baseURL,
    params,
  });
}

// 获取单一库位上架详情
export function getLocationStorageDetails(params: any) {
  return ajaxService({
    url: '/warehouse/location/StorageDetails',
    method: 'get',
    baseURL,
    params,
  });
}

// 获取单一库位上架详情
export function getLocationOutboundDetails(params: any) {
  return ajaxService({
    url: '/warehouse/location/outboundDetails',
    method: 'get',
    baseURL,
    params,
  });
}
